package com.jddup.program.comparator;

import com.jddup.common.pojo.TableColumn;
import com.jddup.common.pojo.TableMeta;
import org.apache.commons.lang3.StringUtils;

import java.util.List;

/**
 * Created by zhangzhenbin on 17-12-11.
 */
public interface AddColumnDDLBuilder extends ColumnSqlBuilder {
    String getTemplateSQL();

    default String build(TableMeta tableMeta, TableColumn tableColumn) {
        StringBuilder columnDDL = new StringBuilder();
        buildColumnSql(tableColumn, columnDDL);

        return getTemplateSQL()
                .replace("{tableName}", tableMeta.getTableName())
                .replace("{tableColumn}", columnDDL);
    }


}
